<template>
    <div>
        <p class="p1"> {{showName}}</p>
        <p> ￥{{showPrice}}</p>
        <van-button icon="minus" @click="del" type="primary" text="下架" />
        <van-button icon="flower-o" type="primary" @click="fn" text="更新" />
    </div>
</template>

<script>
import axios from 'axios'
    export default {
        props: {
            showName: String,
            showPrice: String,
            showId: String,
        },
        data() {
            return {
                id: this.showId,
            }
        },
        methods: {
            del() {
                axios.delete("http://localhost:8087/shows/deleteShow/" + this.showId).then((res)=>{
                    console.log(res.data);
                    history.go(0);
                })
            },
            fn(){
                this.$router.push({
                    name:'Upshow',
                    params: {
                        id: this.id,
                    }
                });
            }
        },
    }
</script>

<style lang="scss" scoped>
    div{
        border: 1px solid #eee;
        padding-top: 10%;
        width: 90%;
        margin-left: 5%;
        margin-bottom: 5%;
        background-color: #eee;
       
        p{
            font-size: 4vw;
            text-align: left;
            margin-left: 7vw;
            margin-right: 7vw;
            
        }
        .p1{
            padding-bottom: 3vw;
        }
     .van-button--normal{
        margin: 5%;
        background-color: skyblue;
     }   

    }
</style>